#include "UserManager.hpp"
using namespace std;

int main()
{
    UserManager um;
    if(um.InitUserManager() == false)
    {
        cout << "init false" << endl;
        return 0;
    }

#if 0
    /* 测试：DearRegister */
    int userid;
    int ret = um.DearRegister(&userid, "张三", 'w', "aQ", "555", "555");
    if(ret < 0)
    {
        cout << "Register false" << endl;
        return 0;
    }
    cout << "uid is " << userid << endl;
#endif

#if 0
    /* 测试：DearLogin */ 
    int ret = um.DearLogin("555", "555", -1);
    if(ret < 0)
    {
        cout << "Login false" << endl;
        return 0;
    }
    cout << "ret: " << ret << endl;

    /* 测试：IsLogin */
    ret = um.IsLogin(ret);
    if(ret == 1)
    {
        cout << "ONLINE" << endl;
    }
    else{
        cout << "OFFLINE" << endl;
    }
#endif

    /* 测试：SetFriend */
    um.setFriend(0, 5);
    um.setFriend(1, 4);

    return 0;
}
